﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace LanDBom.Models.Procure
{
    public class Modlfy_App_bu
    {
        LDbaseEntities LD = new LDbaseEntities();
        public Applications GetAPP(string Ap_bian)
        {
            Applications app = LD.Applications.SingleOrDefault(x => x.AP_bian == Ap_bian);

            return app;
        }

        public int ChangeApp_bu(Applications app)
        {
            Applications apps = GetAPP(app.AP_bian);

            apps.App_bu = app.App_bu;

            return LD.SaveChanges();
        }

        public int ChangeApp(Applications app)
        {
            Applications apps = GetAPP(app.AP_bian);

            apps.App_bu = app.App_bu;
            apps.App_zhuang = app.App_zhuang;
            apps.APP_shr = app.APP_shr;
            apps.APP_liy = app.APP_liy;
            apps.App_bu = app.App_bu;
            return LD.SaveChanges();
        }
    }
}